package com.meilian.clients;

import com.meilian.param.PageParam;
import com.meilian.param.ProductHotParam;
import com.meilian.pojo.Category;
import com.meilian.utils.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

//类别调用的接口
@FeignClient("category-service")//放服务名称
public interface CategoryClient {

    @GetMapping("/category/promo/{categoryName}")
    R byName(@PathVariable String categoryName);

    //根据类别集合查询类别id
    @PostMapping("/category/hots")
    R hots (@RequestBody ProductHotParam productHotParam);


    @GetMapping("/category/list")
    R list();
    //2023-1-5
    @PostMapping("/category/admin/list")
    R adminPageList(@RequestBody PageParam pageParam);

    @PostMapping("/category/admin/save")
    R adminSave(@RequestBody Category category);

    @PostMapping("/category/admin/remove")
    R adminRemove(@RequestBody Integer categoryId);

    @PostMapping("/category/admin/update")
    R adminUpdate(@RequestBody Category category);
}
